package com.ruoyi.demo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.demo.mapper.AuctionUserMapper;
import com.ruoyi.demo.domain.AuctionUser;
import com.ruoyi.demo.service.IAuctionUserService;

/**
 * 拍卖小程序用户Service业务层处理
 * 
 * @author metaee
 * @date 2025-02-24
 */
@Service
public class AuctionUserServiceImpl implements IAuctionUserService 
{
    @Autowired
    private AuctionUserMapper auctionUserMapper;

    /**
     * 查询拍卖小程序用户
     * 
     * @param userId 拍卖小程序用户主键
     * @return 拍卖小程序用户
     */
    @Override
    public AuctionUser selectAuctionUserByUserId(Long userId)
    {
        return auctionUserMapper.selectAuctionUserByUserId(userId);
    }

    /**
     * 查询拍卖小程序用户列表
     * 
     * @param auctionUser 拍卖小程序用户
     * @return 拍卖小程序用户
     */
    @Override
    public List<AuctionUser> selectAuctionUserList(AuctionUser auctionUser)
    {
        return auctionUserMapper.selectAuctionUserList(auctionUser);
    }

    /**
     * 新增拍卖小程序用户
     * 
     * @param auctionUser 拍卖小程序用户
     * @return 结果
     */
    @Override
    public int insertAuctionUser(AuctionUser auctionUser)
    {
        auctionUser.setCreateTime(DateUtils.getNowDate());
        return auctionUserMapper.insertAuctionUser(auctionUser);
    }

    /**
     * 修改拍卖小程序用户
     * 
     * @param auctionUser 拍卖小程序用户
     * @return 结果
     */
    @Override
    public int updateAuctionUser(AuctionUser auctionUser)
    {
        auctionUser.setUpdateTime(DateUtils.getNowDate());
        return auctionUserMapper.updateAuctionUser(auctionUser);
    }

    /**
     * 批量删除拍卖小程序用户
     * 
     * @param userIds 需要删除的拍卖小程序用户主键
     * @return 结果
     */
    @Override
    public int deleteAuctionUserByUserIds(Long[] userIds)
    {
        return auctionUserMapper.deleteAuctionUserByUserIds(userIds);
    }

    /**
     * 删除拍卖小程序用户信息
     * 
     * @param userId 拍卖小程序用户主键
     * @return 结果
     */
    @Override
    public int deleteAuctionUserByUserId(Long userId)
    {
        return auctionUserMapper.deleteAuctionUserByUserId(userId);
    }

    /**
     * 根据openid查询用户
     * 
     * @param openid 微信openid
     * @return 用户信息
     */
    @Override
    public AuctionUser selectAuctionUserByOpenid(String openid) {
        return auctionUserMapper.selectAuctionUserByOpenid(openid);
    }

    /**
     * 根据手机号查询用户
     * 
     * @param phone 手机号
     * @return 用户信息
     */
    @Override
    public AuctionUser selectAuctionUserByPhone(String phone) {
        return auctionUserMapper.selectAuctionUserByPhone(phone);
    }
}
